Here's a basic teleport script that makes the player hold their use key on the trigger before being able to use it and comments as to what each line does::
main: thread port1 thread stufftolookat end //Church West Door -> Hole in the Floor port1: local.trig = spawn trigger_use // When the player presses their use key, do the trigger local.trig targetname port1 // Give the trigger a name local.trig.origin = ( -215 -192 100 ) // Where is this trigger at? Starting spot for your teleport local.trig setsize ( -5 -32 -60 ) ( 5 32 60 ) // How big is the trigger? Set the area for the player to activate it $port1 waittill trigger // Wait until the player hits the trigger to do stuff local.player = parm.other // Allow us to do stuff to the player if(local.player.useheld) // If they are holding their use key do stuff { local.player tele ( -2700 -2110 240 ) // Where are you moving the player to? Ending port for your teleport local.player hurt 5 // Hurts the player 5 health for going through the portal, not necessary, makes them think twice though $port1 remove // Get rid of the teleport by using the name defined above for a few seconds so other players wont get stuck on them wait 2 // waiting a few seconds thread port1 // turning the portal back on so we can go through it again } end stufftolookat: // This can be literally anything, I have my servers set up with portals on doors and a line of bangalores on the door, looks kinda neat. You can use a light or something else, or nothing at all if you don't want there to be a visible thing for players to see where teleports are // ----------------------------------------------------- // ---------- Church West Door ------------------------- // ----------------------------------------------------- local.static = spawn script_model local.static model "items/bangalore.tik" local.static.origin = ( -215 -192 60 ) local.static.angles = ( 0 180 0 ) local.static.scale = 1 local.static ghost local.static = spawn script_model local.static model "items/bangalore.tik" local.static.origin = ( -215 -192 80 ) local.static.angles = ( 0 180 0 ) local.static.scale = 1 local.static ghost local.static = spawn script_model local.static model "animate/bangalore_pulsating.tik" local.static.origin = ( -215 -192 100 ) local.static.angles = ( 0 0 0 ) local.static.scale = 1 local.static ghost local.static = spawn script_model local.static model "items/bangalore.tik" local.static.origin = ( -215 -192 120 ) local.static.angles = (0 180 0 ) local.static.scale = 1 local.static ghost local.static = spawn script_model local.static model "items/bangalore.tik" local.static.origin = ( -215 -192 140 ) local.static.angles = ( 0 180 0 ) local.static.scale = 1 local.static ghost end



Reply With Quote

